﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/MenuMaster.Master" AutoEventWireup="true" CodeBehind="ViewAllPages.aspx.cs" Inherits="Department.admin.SiteStructure.ViewAllPages" %>
<asp:Content ID="ContentHead" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="ContentMain" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<h1> <asp:HyperLink ID="addHyperLink" NavigateUrl="~/admin/SiteStructure/AddPage.aspx" CssClass="sub_show" runat="server">Добави страница</asp:HyperLink></h1>
<div id="page-heading">
        <h1>Всички страници</h1>
    </div>
    <!-- end page-heading -->
    <table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
        <tr>
            <th rowspan="3" class="sized">
                <img src="../images/shared/side_shadowleft.jpg" width="20" height="300" alt="" />
            </th>
            <th class="topleft">
            </th>
            <td id="tbl-border-top">
                &nbsp;
            </td>
            <th class="topright">
            </th>
            <th rowspan="3" class="sized">
                <img src="../images/shared/side_shadowright.jpg" width="20" height="300" alt="" />
            </th>
        </tr>
        <tr>
            <td id="tbl-border-left">
            </td>
            <td>
                <!--  start content-table-inner ...................................................................... START -->
                <div id="content-table-inner">
                    <!--  start table-content  -->
                    <div id="table-content">
                        <asp:SqlDataSource ID="ListPagesDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:DepartmentConnectionString %>"
                            
                            
                            SelectCommand="SELECT P.ID, P.Name, P.IsMain, M.Name AS MenuName, M.FacDeptID FROM Pages AS P INNER JOIN Menu AS M ON P.MenuID = M.ID WHERE (M.FacDeptID = dbo.uf_get_department_id()) ORDER BY P.Name DESC">
                                                        
                        </asp:SqlDataSource>
                        <form id="mainform" action="">
                        <table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">
                            <tr>
                                <th class="table-header-check">
                                    <asp:CheckBox ID="toggleall" runat="server" AutoPostBack="True" OnCheckedChanged="toggleall_CheckedChanged"/>
                                </th>
                                <th class="table-header-repeat line-left minwidth-1">
                                    <asp:LinkButton ID="sortByName" OnCommand="sortByParam_Click" CommandArgument="Name" runat="server">Заглавие</asp:LinkButton>
                                </th>
                                <th class="table-header-repeat line-left minwidth-1">
                                    <asp:LinkButton ID="sortByMenuName" OnCommand="sortByParam_Click" CommandArgument="MenuName" runat="server">Меню</asp:LinkButton>
                                </th>
                                <th class="table-header-repeat line-left">
                                    <asp:LinkButton ID="sortByIsMain" OnCommand="sortByParam_Click" CommandArgument="IsMain" runat="server">Главна</asp:LinkButton>
                                </th>
                                <th class="table-header-options line-left">
                                    <a href="">Действия</a>
                                </th>
                            </tr>
                            <asp:ListView ID="ListPages" runat="server" DataSourceID="ListPagesDataSource">
                                <ItemTemplate>
                                    <tr style="">
                                        <td>
                                            <asp:CheckBox ID="CheckBoxIsMarked" runat="server" />
                                        </td>
                                        <td>
                                            <asp:Label ID="PageNameLabel" runat="server" Text='<%# Eval("Name") %>' />
                                        </td>
                                        <td>
                                            <asp:Label ID="MenuNameLabel" runat="server" Text='<%# Eval("MenuName") %>' />
                                        </td>
                                        <td>
                                            <asp:CheckBox ID="IsMainCheckBox" runat="server" Checked='<%# (DataBinder.Eval(Container.DataItem,"IsMain")) %>' />
                                        </td>
                                        <td class="options-width">
                                            <asp:HyperLink ID="Edit" title="Редактирай" class="icon-1 info-tooltip" runat="server"
                                                NavigateUrl='<%#"/admin/SiteStructure/EditPages.aspx?id=" + DataBinder.Eval(Container.DataItem,"ID")%>'>
                                            </asp:HyperLink>
                                            <%--<asp:LinkButton ID="deleteButton" title="Направи неактивно" OnCommand="markInactiveButton_Click" CommandArgument='<%#Eval("ID") %>' runat="server" class="icon-2 info-tooltip"></asp:LinkButton>--%>
                                            <asp:Label Visible="false" ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' />
                                        </td>
                                    </tr>
                                </ItemTemplate>
                                <AlternatingItemTemplate>
                                    <tr style="" class="alternate-row">
                                        <td>
                                            <asp:CheckBox ID="CheckBoxIsMarked" runat="server" />
                                        </td>
                                        <td>
                                            <asp:Label ID="PageNameLabel" runat="server" Text='<%# Eval("Name") %>' />
                                        </td>
                                        <td>
                                            <asp:Label ID="MenuNameLabel" runat="server" Text='<%# Eval("MenuName") %>' />
                                        </td>
                                        <td>
                                            <asp:CheckBox ID="IsMainCheckBox" runat="server" Checked='<%# (DataBinder.Eval(Container.DataItem,"IsMain")) %>' />
                                        </td>
                                        <td class="options-width">
                                            <asp:HyperLink ID="Edit" title="Редактирай" class="icon-1 info-tooltip" runat="server"
                                                 NavigateUrl='<%#"/admin/SiteStructure/EditPages.aspx?id=" + DataBinder.Eval(Container.DataItem,"ID")%>'>
                                            </asp:HyperLink>
                                            <%--<asp:LinkButton ID="deleteButton" title="Направи неактивно" OnCommand="markInactiveButton_Click" CommandArgument='<%#Eval("ID") %>'  runat="server" class="icon-2 info-tooltip">
                                            </asp:LinkButton>--%>
                                            <asp:Label Visible="false" ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' />
                                        </td>
                                    </tr>
                                </AlternatingItemTemplate>
                            </asp:ListView>
                        </table>
                        <asp:DataPager ID="DataPagerListView" runat="server" PageSize="10" PagedControlID="ListPages">
                            <Fields>
                                <asp:NumericPagerField ButtonType="Link" NextPageText="" PreviousPageText="" ButtonCount="999999" />
                            </Fields>
                        </asp:DataPager>
                        </form>
                    </div>
                    <!--  end content-table  -->
                    <!--  start actions-box ............................................... -->
                    <div id="actions-box">
                        <a href="" class="action-slider"></a>
                        <div id="actions-box-slider">
                            <%--<asp:LinkButton ID="MarkAllInactive"  
                                CssClass="action-edit" runat="server" oncommand="markAllInactive_Click">Направи неактивни</asp:LinkButton>--%>
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                    <!-- end actions-box........... -->
                    <div class="clear">
                    </div>
                </div>
                <!--  end content-table-inner ............................................END  -->
            </td>
            <td id="tbl-border-right">
            </td>
        </tr>
        <tr>
            <th class="sized bottomleft">
            </th>
            <td id="tbl-border-bottom">
                &nbsp;
            </td>
            <th class="sized bottomright">
            </th>
        </tr>
    </table>
    <div class="clear">
        &nbsp;</div>
    <!--  end content -->
  
</asp:Content>
